/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package arg_program;

import arg.program.gui.DetailsJFrame;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 *
 * @author Jasmin
 */
public class DetailsQuery extends DetailsJFrame{
    
    private Connection conn;
    final String DB_URL = "jdbc:derby://localhost:1527/AnimeDB;create=true";
    
    //Constructor
    public DetailsQuery()
    {
        
    }
    
    public void Details()
    {       
        try
        {    
            conn = DriverManager.getConnection(DB_URL, "nbuser", "nbuser");           
            
            Statement stmt = conn.createStatement();
            
            String sqlStatement = "SELECT ENGTITLE FROM ANIME_TABLE";
            
            ResultSet result = stmt.executeQuery(sqlStatement);                             
            
            while(result.next())
            {
                String engTitle = result.getString("*");              
                //listModel.addElement(engTitle);               
            }
            
            //jList1.setModel(listModel);    
        }
        catch(Exception ex)
        {
            System.out.println("ERROR: " + ex.getMessage());
        }       
    }
}
